public class Draw {
    private int height;
    public Draw(int h){
        if (h > 3)
            height = h;
    }
    public void drawTriangle(){
        if(height<=0)return;
        for(int i=1;i<=height;i++){
            for(int m=height-1;m>0;m--){
                System.out.print(" ");
            }
            for(int n=0;n<2*i-1;n++){
                System.out.print("*");
        }
            System.out.println();
        }
    }
        public void drawRectangle() {
            if (height <= 0) return;
            for (int i = 1; i <= height; i++) {
                for (int p = 1; p <= height + 2; p++) {
                    System.out.print("*");
                }
                System.out.println();
            }
    }
    public void drawsquare(){
        if (height <= 0) return;
        for(int i=1;i<=height;i++){
            for(int q=1;q<=height;q++){
                System.out.print("*");
            }
            System.out.println();
        }}
    public void drawparallelogram(){
        if (height <= 0) return;
        for(int i=1;i<=height;i++){
            for(int x=0;x<height-i;x++){
                System.out.print(" ");
            }
            for(int y=1;y<height;y++){
                System.out.print("*");
            }
            System.out.println();
        }}
}
class Main{
    public static void main(String[]args){
        Draw draw1=new Draw(5);
        draw1.drawRectangle();
        System.out.println();
        draw1.drawparallelogram();
        System.out.println();
        draw1.drawsquare();
        System.out.println();
        draw1.drawTriangle();
    }
}

